const model = require("../models/goods")

// 添加
function addGoods(goods=[]) {
    console.log("goodsController addGoods");
    return model.addGoods(goods)
}

// 删除
function deleteGoods(goods) {
    console.log("goodsController deleteGoods");
    return model.deleteGoods(goods)
}

// 更新/修改
function updataGoods(id,goods) {
    console.log("goodsController updataGoods");
    return model.updataGoods(id,goods)
}

// 查询全部
function getAllGoods() {
    console.log("goodsController getAllGoods");
    return model.getAllGoods()
}

// 分页查询
function getGoodsByPage(page) {
    console.log("goodsController getGoodsByPage");
    return model.getGoodsByPage(page)
}

module.exports = {
    addGoods,
    deleteGoods,
    updataGoods,
    getAllGoods,
    getGoodsByPage,
}